import config from "@/config"
import http from "@/utils/request"

export default {
  upload: {
		url: `${config.API_URL}/admin/file/upload`,
		name: "上传文件",
		post: async function(data={}){
			return await http.post(this.url, data, {
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			});
		}
	},
	uploadFile: {
		url: `${config.API_URL}/admin/file/upload`,
		name: "上传文件",
		post: async function(data={}){
			return await http.post(this.url, data);
		}
	},
	setFile: {
		url: `${config.API_URL}/cms/common/file/upload/sign`,
		name: "设置文件格式名字",
		get: async function(params){
			return await http.get(this.url+params)
		}
	},
	awsUploadFile: {
		name: "上传文件aws",
		put: async function(url,data,headers){
			return await http.put(url, data, {
				headers: headers
			});
		}
	},
	creator_uploadFile: {
		url: `${config.API_URL}/file/upload`,
		name: "creator端上传文件",
		post: async function(data={}){
			return await http.post(this.url,data,{
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			})
		}
	}
}
